package com.erp.erp_servers.Quoted_Info.imp;


import com.erp.erp_dao.Quoted_Info.QuotedInfoexDao;

import com.erp.erp_entitys.Quoted_Info.QuotedInfoex;
import com.erp.erp_servers.Quoted_Info.QuotedInfoexService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 报价主信息扩展表(QuotedInfoex)表服务实现类
 *
 * @author makejava
 * @since 2020-10-11 18:00:09
 */
@Service("quotedInfoexService")
public class QuotedInfoexServiceImpl implements QuotedInfoexService {
    @Resource
    private QuotedInfoexDao quotedInfoexDao;

    /**
     * 通过ID查询单条数据
     *
     * @param quotedid 主键
     * @return 实例对象
     */
    @Override
    public QuotedInfoex queryById(Integer quotedid) {
        return this.quotedInfoexDao.queryById(quotedid);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
    @Override
    public List<QuotedInfoex> queryAllByLimit(int offset, int limit) {
        return this.quotedInfoexDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param quotedInfoex 实例对象
     * @return 实例对象
     */
    @Override
    public QuotedInfoex insert(QuotedInfoex quotedInfoex) {
        this.quotedInfoexDao.insert(quotedInfoex);
        return quotedInfoex;
    }

    /**
     * 修改数据
     *
     * @param quotedInfoex 实例对象
     * @return 实例对象
     */
    @Override
    public QuotedInfoex update(QuotedInfoex quotedInfoex) {
        this.quotedInfoexDao.update(quotedInfoex);
        return this.queryById(quotedInfoex.getQuotedid());
    }

    /**
     * 通过主键删除数据
     *
     * @param quotedid 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer quotedid) {
        return this.quotedInfoexDao.deleteById(quotedid) > 0;
    }
}